Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 5b1332c7ddd5af96cc7f0926489ba2750d56bce3


Parents : 2b854f7
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-16T10:47:47-06:00

Add Wine setup task and update build workflows

- Introduced a new task for setting up the Wine environment for Windows cross-builds in Taskfile.yml.
- Updated build-test.yml and build.yml workflows to include 'xvfb' in the Wine installation command for improved compatibility.
- Refactored the Wine setup process in the build workflow to utilize the new task instead of inline commands, enhancing maintainability.

Changes

3 files changed, 9 insertions(+), 24 deletions(-)


Diff

diff --git a/.gitea/workflows/build-test.yml b/.gitea/workflows/build-test.yml
index 7394048d..ca1db9c9 100644
--- a/.gitea/workflows/build-test.yml
+++ b/.gitea/workflows/build-test.yml
@@ -40,7 +40,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
- sudo apt-get install -y wine32:i386 wine64 patchelf libopusfile0 ffmpeg espeak-ng nsis zip rpm flatpak flatpak-builder elfutils appstream appstream-util
+ sudo apt-get install -y wine32:i386 wine64 xvfb patchelf libopusfile0 ffmpeg espeak-ng nsis zip rpm flatpak flatpak-builder elfutils appstream appstream-util
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Install runtimes required for Flatpak build
flatpak install --user -y flathub org.freedesktop.Platform//24.08 org.freedesktop.Sdk//24.08 org.electronjs.Electron2.BaseApp//24.08

diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
index 4cd66778..ccece366 100644
--- a/.gitea/workflows/build.yml
+++ b/.gitea/workflows/build.yml
@@ -80,7 +80,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
- sudo apt-get install -y wine32:i386 wine64 patchelf libopusfile0 ffmpeg espeak-ng nsis zip rpm flatpak flatpak-builder elfutils
+ sudo apt-get install -y wine32:i386 wine64 xvfb patchelf libopusfile0 ffmpeg espeak-ng nsis zip rpm flatpak flatpak-builder elfutils
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Setup Task
@@ -109,32 +109,12 @@ jobs:
run: task dist:fe:flatpak
- name: Setup Wine Environment
- env:
- WINEDEBUG: -all
- WINEARCH: win64
- run: |
- echo "Downloading Windows Python and Git..."
- wget -q https://www.python.org/ftp/python/3.13.1/python-3.13.1-amd64.exe
- wget -q https://github.com/git-for-windows/git/releases/download/v2.52.0.windows.1/Git-2.52.0-64-bit.exe
-
- echo "Initializing Wine prefix..."
- wine wineboot --init
-
- echo "Installing Python 3.13 into Wine..."
- wine python-3.13.1-amd64.exe /quiet InstallAllUsers=1 TargetDir=C:\Python313 PrependPath=1
-
- echo "Installing Git into Wine..."
- wine Git-2.52.0-64-bit.exe /VERYSILENT /NORESTART
-
- echo "Installing build dependencies in Wine Python..."
- wine C:/Python313/python.exe -m pip install --upgrade pip
- wine C:/Python313/python.exe -m pip install cx_Freeze poetry
- wine C:/Python313/python.exe -m pip install -r requirements.txt
+ run: task setup:wine
- name: Build Electron App (Windows EXE and NSIS)
env:
WINEDEBUG: -all
- WINE_PYTHON: "wine C:/Python313/python.exe"
+ WINE_PYTHON: "xvfb-run wine C:/Python313/python.exe"
run: task dist:win:wine
- name: Prepare release assets

diff --git a/Taskfile.yml b/Taskfile.yml
index 69e32e67..a82d53be 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -62,6 +62,11 @@ tasks:
desc: Install all dependencies (frontend and backend)
deps: [deps:fe, deps:be]
+ setup:wine:
+ desc: Setup Wine environment for Windows cross-builds
+ cmds:
+ - ./scripts/setup_wine_env.sh
+
deps:fe:
desc: Install Node.js dependencies
cmds:


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────